{% extends "base.html" %}
{% block content %}
<h2>Medical Records</h2>
<table>
<tr>
  <th>ID</th>
  <th>Patient</th>
  <th>Doctor</th>
  <th>Date</th>
  <th>Diagnosis</th>
  <th>Symptoms</th>
  <th>Observations</th>
</tr>
{% for r in records %}
<tr>
  <td>{{ r.record_id }}</td>
  <td>{{ r.patient_name }}</td>
  <td>{{ r.staff_name }}</td>
  <td>{{ r.visit_date }}</td>
  <td>{{ r.diagnosis }}</td>
  <td>{{ r.symptoms }}</td>
  <td>{{ r.observation }}</td>
</tr>
{% endfor %}
</table>

<h3>Add Medical Record</h3>
<form action="{{ url_for('medical_record_new') }}" method="post">
  Patient:
  <select name="patient_id">
    {% for p in patients %}
      <option value="{{ p.patient_id }}">{{ p.name }}</option>
    {% endfor %}
  </select><br>
  Doctor:
  <select name="staff_id">
    {% for s in staff %}
      <option value="{{ s.staff_id }}">{{ s.name }}</option>
    {% endfor %}
  </select><br>
  Diagnosis: <input name="diagnosis"><br>
  Symptoms: <input name="symptoms"><br>
  Observations: <input name="observation"><br>
  <button type="submit">Submit</button>
</form>
{% endblock %}
